package com.iflytek.cosmo.ocr.common.core;

import java.util.concurrent.ExecutorService;

import com.github.tobato.fastdfs.service.AppendFileStorageClient;
import com.iflytek.cosmo.ocr.common.config.ArgusProperties;
import com.iflytek.cosmo.ocr.common.util.GsUtil;
import com.iflytek.cosmo.ocr.dao.ExportTaskDao;
import com.iflytek.cosmo.ocr.dao.OcrFileDao;
import com.iflytek.cosmo.ocr.dao.OcrResultDao;
import com.iflytek.cosmo.ocr.service.ArgusPostService;
import com.iflytek.cosmo.ocr.service.ExportTaskService;
import com.iflytek.cosmo.ocr.service.FileService;
import com.iflytek.cosmo.ocr.service.RecogniseService;
import com.iflytek.cosmo.ocr.service.RedisService;
import org.springframework.web.client.RestTemplate;

/**
 *
 */
public class BeanHelper {
	
	public static ExportTaskDao getExportTaskDao() {
        return SpringContextUtil.getBean(ExportTaskDao.class);
    }
	
	public static AppendFileStorageClient getStorageClient() {
        return SpringContextUtil.getBean(AppendFileStorageClient.class);
    }

    public static ExportTaskService getExportServiceBean() {
        return SpringContextUtil.getBean(ExportTaskService.class);
    }

    public static FileService getFileService() {
        return SpringContextUtil.getBean(FileService.class);
    }

    public static RedisService getRedisService() {
        return SpringContextUtil.getBean(RedisService.class);
    }

    public static OcrFileDao getOcrFileDao() {
        return SpringContextUtil.getBean(OcrFileDao.class);
    }

    /**
     *
     * @return
     */
    public static FileService getFileServiceBean()
    {
        FileService fileService = (FileService) SpringContextUtil.getBean(FileService.class);

        return  fileService;
    }
    
    /**
    *
    * @return
    */
   public static RecogniseService getRecogniseService()
   {
	   RecogniseService recogniseService = (RecogniseService) SpringContextUtil.getBean(RecogniseService.class);

       return  recogniseService;
   }

    /**
     *
     * @return
     */
    public  static OcrResultDao getOcrResultDao()
    {
        OcrResultDao dao=(OcrResultDao)SpringContextUtil.getBean(OcrResultDao.class);

        return  dao;
    }

    /**
     *
     * @return
     */
    public  static RestTemplate getRestTemplate()
    {
        RestTemplate restTemplate=(RestTemplate)SpringContextUtil.getBean("restTemplate");
        return  restTemplate;
    }

    /**
     *
     * @return
     */
    public static RecognizeConfig getRecognizeConfig()
    {
        RecognizeConfig config=(RecognizeConfig)SpringContextUtil.getBean("recognizeConfig");
        return  config;
    }

    public static ArgusProperties getArgusProperties() {
        ArgusProperties obj=SpringContextUtil.getBean(ArgusProperties.class);
        return  obj;
    }

    public static ArgusPostService getArgusPostService() {
        ArgusPostService obj=SpringContextUtil.getBean(ArgusPostService.class);
        return  obj;
    }

    public static GsUtil getGsUtil() {
        return SpringContextUtil.getBean(GsUtil.class);
    }

    public static ExecutorService getFastDFSUploadTheadpool() {
        return (ExecutorService) SpringContextUtil.getBean("fastDFSUploadTheadpool");
    }
}
